import { EntitySchema } from 'typeorm'

export const Answer = new EntitySchema({
  name: 'Answer',
  columns: {
    id: {
      primary: true,
      type: 'int',
      generated: true
    },
    questionId: {
      type: 'varchar'
    },
    answerId: {
      type: 'varchar'
    },
    report: {
      type: 'varchar',
      nullable: true
    },
    // 时间戳 s
    createtime: {
      type: 'varchar'
    },
    // 时间戳 s
    updatetime: {
      type: 'varchar'
    },
    // 状态 初始值1，后面可能用到
    status: {
      type: 'varchar',
      nullable: true
    }
  },
  relations: {
    frequency: {
      target: 'Frequency',
      type: 'many-to-one',
      joinColumn: true
    }
  }
})
